package cn.zktr.Personnel.model.service.ouyangpeng;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONArray;

import cn.zktr.Personnel.model.dao.IntentionDAO;
import cn.zktr.Personnel.model.dao.ouyangpeng.RetDemDao;
//import cn.zktr.Personnel.model.dao.ouyangpeng.RetIttDao;
import cn.zktr.Personnel.model.dao.ouyangpeng.RetRseDao;
import cn.zktr.Personnel.model.mappers.ouyangpng.PerRetRseMapper;
import cn.zktr.Personnel.model.pojos.PerIntention;
import cn.zktr.Personnel.model.pojos.PerPmsPot;
import cn.zktr.Personnel.model.pojos.PerPmsSex;
import cn.zktr.Personnel.model.pojos.PerPmsStm;
import cn.zktr.Personnel.model.pojos.PerRetDem;
import cn.zktr.Personnel.model.pojos.PerRetRfs;
//import cn.zktr.Personnel.model.pojos.PerRetItt;
import cn.zktr.Personnel.model.pojos.PerRetRse;
import cn.zktr.Personnel.model.pojos.PerRetWAlt;

@Service
@Transactional(rollbackOn=Exception.class)
public class RetRseService {
	/**
	 * 简历
	 */
	@Autowired
	private PerRetRseMapper rsemaper;
	@Autowired
	private RetRseDao rsedao;
	@Autowired
	private RetDemDao demdao;
	
    //查询所有
	public JSONArray selerseAll(){
		return rsemaper.selerseAll();
		
	}
	//根据ID查询
	public List<PerRetRse> selectrseid(Integer rseid) {
		return rsemaper.selectresid(rseid);
	}
	//计划要求
	public JSONArray selectjihuayqss(Integer altid) {
		return rsemaper.selectjihuayqss(altid);
	}
	//初步审核查询的表
	public List<PerRetRse> selectchububiao(){
		return rsemaper.selectchububiao();
	}
	//查询各个计划
//	public JSONArray selectjihuafl(Integer altfl) {
//		return rsemaper.selectjihuafl(altfl);
//	}
	//下拉-性别
	public List<PerPmsSex> selectsex(){
		return rsemaper.selectsex();
	}
	//下拉-员工
	public List<PerPmsPot> selectyuangong(){
		return rsemaper.selectyuangong();
	}
	//下拉-负责人列表
	public List<PerPmsStm> selectfuzenren(){
		return rsemaper.selectfuzenren();
	}     
	//下拉-计划
	public List<PerRetWAlt> selectjihua(){
		return rsemaper.selectjihua();
	}
	//下拉-学历
    public List<PerRetRfs> selectxueli(){
    	return rsemaper.selectxueli();
    }
    public List<PerRetWAlt> selectyiyouzy(){
    	return rsemaper.selectyiyouzy();
    }
	//添加简历
	public void rsexz(PerRetRse rse,PerRetWAlt alt) {
	rsedao.save(rse);
	PerRetDem dem=new PerRetDem();
	List<PerRetRse> ret = (List<PerRetRse>) rsedao.findAll();
	dem.setPerRetRse(ret.get(ret.size()-1));
	dem.setPerRetWAlt(alt);
	demdao.save(dem);
    }
}
